package com.itheima.Test08;

import java.util.Calendar;

public class Demo08 {
    public static void main(String[] args) {
        /*
        请编程，计算并打印“1949年10月1日”那天是星期几？

        Calendar cla = Calendar.getInstance();
        cla.set(Calendar.YEAR,1949);
        cla.set(Calendar.MONTH,9);
        cla.set(Calendar.DAY_OF_MONTH,1);
        String[] weekArray = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
        int week = cla.get(Calendar.DAY_OF_WEEK);
         System.out.println(weekArray[week-1]);
    }*/
        Calendar C = Calendar.getInstance();
        C.set(Calendar.YEAR, 1949);
        C.set(Calendar.MONTH, 9);
        C.set(Calendar.DAY_OF_MONTH, 1);
        String[] array = {"星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
        int i = C.get(Calendar.DAY_OF_WEEK);
        System.out.println(array[i - 1]);
    }
}
